#include <iostream>
#include "PLC.h"
using namespace PLC;
using namespace std;
class A: public PLC_Function<INT>{
public:
	A(int funcID, varMap* vMap) : PLC_Function(funcID, vMap){
		this->addReturnVar<INT>();
		this->returnValue = new INT();
		::PLC::RFM->addVarToVarMap(237,createFuncVariable<INT>(237,(new INT(0))));
	}
	void funcExecute(INT*X){
		auto* X_t = new INT(::PLC::RFM->getSymbolByID<INT*>(237));
		*X_t = *X;
if((*X) ==((*(new INT(2)))) ){
		*this->returnValue  = (*(new INT(2)));
}
else if((*X) ==((*(new INT(1)))) ){
		*this->returnValue  = (*(new INT(1)));
}else{
		auto _X0=(*X) -((*(new INT(1)))) ;
		auto _X1=(*X) -((*(new INT(2)))) ;
		*this->returnValue  = (*::PLC::RFM->getSymbolByID<A*>(219)->callFunc(&_X0)) +(*::PLC::RFM->getSymbolByID<A*>(219)->callFunc(&_X1)) ;
}
	}
	INT* callFunc(INT*X){
		funcExecute(X);
		return new INT(getFuncReturn<INT*>());
	}
};
void initFunc(){
	::PLC::RFM->addVarToVarMap(219, new A(219, RFM));
}

int main(){
	initFunc();
		auto _X2=(*(new INT(10)));
		*::PLC::RFM->getSymbolByID<A*>(219)->callFunc(&_X2);
}